

<html>
<head>
	<title>Thanks for report us.</title>
</head>
<body>
<center>
<br>
<?php 
//Rquire MySqlAdapter.
require_once(dirname(__FILE__).'/../db/MySqlAdapter.php');

//echo "<br>Step 1: open a connection to the DB<br>";
$conn = MySqlAdapter::connect1();

if (isset($_REQUEST['txurl']) && isset($_REQUEST['txnme']) && isset($_REQUEST['txeml']) && isset($_REQUEST['txpho']) && isset($_REQUEST['seltyp']) && isset($_REQUEST['txsub']) && isset($_REQUEST['txdsc']))
	if (($_REQUEST['txnme']) && ($_REQUEST['txeml']) && ($_REQUEST['seltyp']) && ($_REQUEST['txsub']))
	{
		//sending all the details to the system admin by email:
		//$msgbody = "sender_email:\t".$_REQUEST['cuemail']."\nsender_name:\t".$_REQUEST['sendername']."\ncontent_body:\n".$_REQUEST['cumsg'];		
		//mail("dudi.email@gmail.com", "Ohel_Shelomo_website: New contact-us msg was added", $msgbody, "From: <ADMIN@Ohel.shelomo.COM>");
		if ($conn):
			$result = MySqlAdapter::connect2();
		else:
			die ("Could not connect to db " . mysql_error());
		endif;

		//echo "<br>Step 5: Insert rows into the books table<br>";	
		//$query = "insert into report values (CURRENT_TIMESTAMP,'".$_REQUEST['sendername']."','".$_REQUEST['cuemail']."','".$_REQUEST['cumsg']."');"; 	
		//echo "insert into report values ( CURRENT_TIMESTAMP,'".$_REQUEST['txurl']."','".$_REQUEST['txnme']."','".$_REQUEST['txeml']."','".$_REQUEST['txpho']."','".$_REQUEST['seltyp']."','".$_REQUEST['txsub']."','".$_REQUEST['txdsc']."');<br/>";
		$query = "insert into report values ( CURRENT_TIMESTAMP,'".$_REQUEST['txurl']."','".$_REQUEST['txnme']."','".$_REQUEST['txeml']."','".$_REQUEST['txpho']."'
,'".$_REQUEST['seltyp']."','".$_REQUEST['txsub']."','".$_REQUEST['txdsc']."');";
		mysql_query($query)   or die ("Invalid insert1 " . mysql_error());
	
		print("Thanks !<br>\n\tYour report was successfully sent.");
		//echo $_REQUEST['cuemail'];
		//echo $_REQUEST['sendername'];
		//echo $_REQUEST['cumsg'];
	}
	else
		{ echo "Please fill all the mandatory fileds.";}
?>
<br/>
<A HREF="javascript:history.back()">Back</A>
<?php
mysql_close($conn);
?>
</center>
</body>
</html>